<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html>
<link rel="stylesheet" href="/site_media/css_style/profilepic/style.css" type="text/css" />

{% extends "base.html" %}
{% block title %}Add Photo{% endblock %}
{% block head %}Change Photo{% endblock %}
{% block content %}
	<div id="wrap">
		<div id="left">
			<div align=center> <img src="{{media_url}}" /> </div>
			<form action="" enctype="multipart/form-data" method="post">
				{% csrf_token %}
				<table>
					{{ form.as_table }}
				</table>
				<input type="submit" value="Submit" />
			</form>
		</div>
		<div id="right">
			{% if user.profileimage_set.all %}
				Profile Photos
				<p> Choose the picture you would like to use as your main profile picture. </p>
				<ul>
					{% for img in user.profileimage_set.all %}
						<li>
							<a href="{{ img.display.url }}"><img src="{{ img.thumbnail.url }}" /></a>
						</li>
					{% endfor %}
				</ul>
			{% else %}
				<p>{{ user.username }} hasn't posted any photos yet.</p>
			{% endif %}
		</div>
	</div>
{% endblock %}